﻿using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel.DataAnnotations;
using internal_website.Meta;
using internal_website.Models.Resources;

namespace internal_website.Models
{
    public class EventType : IEventType
    {
        #region Constructor

        public EventType()
        {
            Events = new Collection<Event>();
        }

        #endregion

        [Key]
        public int Id { get; set; }
        public bool Active { get; set; }


        #region Localized display and model validation attributes
        [Display(Name = "EventType_Name_Display_Name", Prompt = "EventType_Name_Display_Prompt", ResourceType = typeof(ValidationStrings))]
        [Required(ErrorMessageResourceName = "EventType_Name_Required", ErrorMessageResourceType = typeof(ValidationStrings))]
        [LocalizedRegex("_Name_LocalizedRegex_Pattern", "EventType_Name_LocalizedRegex_ErrorMessage", errorMessageResourceType: typeof(ValidationStrings))]
        #endregion
        public string Name { get; set; }

        #region Localized display and model validation attributes
        [Display(Name = "EventType_Description_Display_Name", Prompt = "EventType_Description_Display_Prompt", ResourceType = typeof(ValidationStrings))]
        [Required(ErrorMessageResourceName = "EventType_Description_Required", ErrorMessageResourceType = typeof(ValidationStrings))]
        [LocalizedRegex("_Description_LocalizedRegex_Pattern", "EventType_Description_LocalizedRegex_ErrorMessage", errorMessageResourceType: typeof(ValidationStrings))]
        #endregion
        public string Description { get; set; }

        #region Navigation properties

        public ICollection<Event> Events { get; set; }

        #endregion

    }
}